import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
import { RootState, AppDispatch } from '@/store'; // 导入 RootState 和 AppDispatch

// 创建一个类型安全的 useSelector hook
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;

// 创建一个类型安全的 useDispatch hook
export const useAppDispatch = () => useDispatch<AppDispatch>();
